import React from 'react';
import {inject, observer} from "mobx-react";
import { WeaTools, WeaTable,WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import {Button} from 'antd';
import { openSingleWindow } from '../common/';
@inject("rss_more_store")
@observer
export default class RssMore extends React.Component{
	constructor(props) {
		super(props);
	    const { eid, tabid, total } = props.location.query;
	    this.props.rss_more_store.getDatas({eid, tabid, total});
	    this.getColumns = this.getColumns.bind(this);
	}
	getColumns(){
		const { status } = this.props.rss_more_store;
		let columns = [{
	          dataIndex: 'title',
	          key: 'title',
	          title: getLabel(388041,"RSS标题"),
	          width: '70%',
	          render: (text,record,index) => {			 
	          	return <div className="wea-url"><a href="javascript:void(0);" onClick={()=>openSingleWindow(text.link)}>{text.name}</a></div>
	          }
        },{
	          dataIndex: 'createtime',
	          key: 'createtime',
	          width: '30%',
	          title: getLabel(30436,"创建时间")
        }];
        return columns;
    }
    render() {
	    const { rss_more_store} = this.props;
	    const { dataSource } = rss_more_store;
	    const pagination = {
			showSizeChanger: true,
		};
	    return (<div>
        	<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@gxalkf`} columns={this.getColumns()} dataSource={dataSource} pagination={pagination} />
      	</div>);
	}
}

